package com.ericsson.middleware.PermanentPooling;

import java.util.concurrent.atomic.AtomicInteger;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public class LampsScheduledProcessor implements LampsProcessor  {

    @Autowired
    private LampsWorker worker;

    private final AtomicInteger counter = new AtomicInteger();
    
    // Scheduled pool: each 60s
    @Scheduled(initialDelayString = "${lampsinitialdelay}", fixedDelayString = "${lampsfixeddelay}")
    public void process() {
        worker.work(counter.incrementAndGet());  
    } 
}
